package jym.tan.movielibrary.utils;

import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

import jym.tan.movielibrary.constant.ThemeConstant;
import jym.tan.movielibrary.dto.MovieSearch;
import jym.tan.movielibrary.model.MovieSearchModel;
import jym.tan.movielibrary.model.ThemeModel;

import org.springframework.beans.BeanUtils;

public class ModelUtils {

	public static List<MovieSearchModel> getMovieSearchModels(List<MovieSearch> movieSearchResults) {
		List<MovieSearchModel> movieSearchModels = new ArrayList<MovieSearchModel>(0);
		for(MovieSearch movieSearchResult : movieSearchResults) {
			MovieSearchModel movieSearchModel = new MovieSearchModel();
			BeanUtils.copyProperties(movieSearchResult, movieSearchModel);
			movieSearchModel.setReleased(movieSearchResult.getReleased());
			movieSearchModels.add(movieSearchModel);
		}		
		return movieSearchModels;
	}
	
	public static Vector<ThemeModel> getThemeModels() {
		Vector<ThemeModel> themeModels = new Vector<ThemeModel>(0);
		themeModels.add(new ThemeModel(ThemeConstant.ThemeName.ACRYL, ThemeConstant.ThemeClass.PLAF_ACRYL));
		themeModels.add(new ThemeModel(ThemeConstant.ThemeName.AERO, ThemeConstant.ThemeClass.PLAF_AERO));
		themeModels.add(new ThemeModel(ThemeConstant.ThemeName.ALUMINIUM, ThemeConstant.ThemeClass.PLAF_ALUMINIUM));
		themeModels.add(new ThemeModel(ThemeConstant.ThemeName.BERNSTEIN, ThemeConstant.ThemeClass.PLAF_BERNSTEIN));
		themeModels.add(new ThemeModel(ThemeConstant.ThemeName.FAST, ThemeConstant.ThemeClass.PLAF_FAST));
		themeModels.add(new ThemeModel(ThemeConstant.ThemeName.GRAPHITE, ThemeConstant.ThemeClass.PLAF_GRAPHITE));
		themeModels.add(new ThemeModel(ThemeConstant.ThemeName.HIFI, ThemeConstant.ThemeClass.PLAF_HIFI));
		themeModels.add(new ThemeModel(ThemeConstant.ThemeName.LUNA, ThemeConstant.ThemeClass.PLAF_LUNA));
		themeModels.add(new ThemeModel(ThemeConstant.ThemeName.MCWIN, ThemeConstant.ThemeClass.PLAF_MCWIN));
		themeModels.add(new ThemeModel(ThemeConstant.ThemeName.MINT, ThemeConstant.ThemeClass.PLAF_MINT));
		themeModels.add(new ThemeModel(ThemeConstant.ThemeName.NOIRE, ThemeConstant.ThemeClass.PLAF_NOIRE));
		themeModels.add(new ThemeModel(ThemeConstant.ThemeName.SMART, ThemeConstant.ThemeClass.PLAF_SMART));
		return themeModels;
	}
}
